#ifndef	NOX_H
#define	NOX_H

#include	"base.h"

struct StringEntry{
	uint32	length;
	uint16*	data;
};

struct TypeEntry{
	uint32	nameIndex;
};

struct ClassEntry{
	uint32	typeIndex;
	uint32	parentTypeIndex;
	uint32	modifiers;
};

struct FieldEntry{
	uint32	nameIndex;
	uint32	declaringTypeIndex;	
	uint32	typeIndex;
	uint32	modifiers;
};

struct PrototypeEntry{
	uint32	nameIndex;
	uint8	parameterCount;
	uint32*	parameterTypeIndexes;
	uint32	returnTypeIndex;
};

struct MethodEntry{
	uint32	prototypeIndex;
	uint32	declaringClassIndex;
	uint32	modifiers;
	uint8	maxLocals;
	uint64	implementationOffset;
};

struct NovaExecutableFile{
	uint32	magic;
	uint8	compilerVersion;
	uint8	runtimeVersion;
	uint32	stringTableSize;
	StringEntry*	stringTable;
	uint32	typeTableSize;
	TypeEntry*		typeTable;
	uint32	classTableSize;
	ClassEntry*		classTable;
	uint32	fieldTableSize;
	FieldEntry*		fieldTable;
	uint32	prototypeTableSize;
	PrototypeEntry*	prototypeTable;
	uint32	methodTableSize;
	MethodEntry*	methodTable;
	uint8*	implementation;
};

#endif